<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>0-100</title>
    <script>
        function myFunction() {
            let num = 0, oddN = 0, evenN = 0;
            for (let i = 0; i <= 100; i++) {
                if (i % 2 === 0) {
                    evenN += i
                } else {
                    oddN += i
                }
                num += i
            }
            document.write("总和等于：" + num + "<br />");
            document.write("偶数和等于：" + evenN + "<br />");
            document.write("奇数和等于：" + oddN);
        }

        myFunction()

    </script>
</head>
<body>

</body>
</html>